<?php
	//声明空数组以免页面遍历数组的时候报错
	$data = array();
	if(Cart::getAllData()){
		//取得购物车商品数据
		$data = Cart::getAllData();
	}
	$cartGoodsNum = 0;
	if(Cart::getTotalNums()){
		//取得购物车商品数量
		$cartGoodsNum = Cart::getTotalNums();
	}
 ?>

<div class="yoho_header">
		<div id="header_top">
			<div class="left_part">
				<a href="<?php echo U('Index/index')?>">YOHO!有货</a>
			</div>
			<div class="right_part">
				<div class="login_box">
					<?php if(isset($_SESSION['aname'])){?>
                
					<span id="hi">Hi~<?php echo $_SESSION['aname']?></span>
					<a id="logout" href="<?php echo U('Login/logout')?>">[退出]</a>
					<?php }else{?>
					<span id="hi">Hi~</span>
					<a id="login_bar" href="<?php echo U('Login/index')?>">[请登录]</a>
					<a id="reg_bar" href="<?php echo U('Reg/index')?>">[免费注册]</a>
					
               <?php }?>
				</div>
				<div class="tag_list_wrapper">
					<ul class="tag_list">
						<li class="tag_item myyoho">
							<?php if(isset($_SESSION['aname'])){?>
                
							<a id="Myyouhuo" href="<?php echo U('Ucenter/index')?>">MY有货</a>
							<?php }else{?>
							<a id="Myyouhuo" href="<?php echo U('Login/index')?>">MY有货</a>
							
               <?php }?>
							<span class="icon-bottomarrow"></span>
						</li>
						<li class="tag_item myorder">
							<span class="icon-papers"></span>
							<a href="">我的订单</a>
						</li>
						<li class="tag_item mycollect">
							<span class="icon-heart"></span>
							<a href="">我的收藏</a>
							
						</li>
						<li class="tag_item message">
							<span class="icon-mail"></span>
							<a href="">消息</a>
							
						</li>
						<li class="tag_item phone">
							<span class="icon-iphone"></span>
							<a href="">手机版</a>
							<div class="qr">
								<div class="qr-img"></div>
								<h3 class="qr-words">扫描二维码</h3>
								<h3 class="qr-words">下载有货手机客户端</h3>
								<p class="qr-more">
									<a id="moredown" href="">更多客户端下载</a>
								</p>
							</div>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
	
	<div class="yoho_nav">
		<div class="navcontent">
			<ul class="first-nav-list">
				<li class="first-nav-item boys">
					<p class="cn boys" >
						<a  href="<?php echo U('Index/index')?>">男生</a>
					</p>
					<p class="en boys">
						<a  href="">BOYS</a>
					</p>
					<div class="sub-nav-wrapper">
						<ul class="sub-nav-list">
							<li class="sub-nav-item">
								<a class="soncate" href="">新品到着</a>
							</li>
							<li class="sub-nav-item">
								<a class="soncate" href="">品牌一览</a>
							</li>
							<?php 
								$cateModel = new \Common\Model\Cate;
								$CateData = Data::channelLevel($cateModel->get());
								
							 ?>
							<?php foreach ($CateData as $v){?>
							<li class="sub-nav-item">
								<a class="secondcate soncate" href="<?php echo U('list/index',array('cid'=>$v['cid']))?>"><?php echo $v['cname']?></a>
								<div class="third-nav-wrapper">
									<div class="third_nav">
										<div id="category05" class="categorywrapper">
											<?php foreach ($v['_data'] as $vv){?>
											<ul class="cate_row1 cate_row" style="border-right: 1px solid black;padding-left: 50px;">
												<li class="catetitle">
													<a href="<?php echo U('List/index',array('cid'=>$vv['cid']))?>"><?php echo $vv['cname']?></a>
												</li>
												<?php foreach ($vv['_data'] as $vvv){?>
												<li class="catedetail">
													<a class="thirdcatelink" href="<?php echo U('List/index',array('cid'=>$vvv['cid']))?>" ><?php echo $vvv['cname']?></a>
												</li>
												<?php }?>
											</ul>
											<?php }?>
											
											
										</div>
										<!--<div class="showdetail">
											<a href="">
												<img src="./Public/Home/images/02922e55f8c84de3a8dc72d03b48238ff8.jpg" alt="" />
											</a>
											<a  class="title" href="">热门小物优选</a>
										</div>-->
									</div>
								</div>
							</li>
							<?php }?>

							<li class="sub-nav-item">
								<a class="soncate" href="<?php echo U('List/index',array('sid'=>2))?>">SALE</a>
							</li>
						</ul>
						
					</div>
				</li>
				
				<li class="first-nav-item girls">
					<p class="cn" >
						<a  href="">女生</a>
					</p>
					<p class="en">
						<a   href="">GIRLS</a>
					</p>
				</li>
				<li class="first-nav-item kids">
					<p class="cn" >
						<a  href="">潮童</a>
					</p>
					<p class="en">
						<a   href="">KIDS</a>
					</p>
				</li>
				<li class="first-nav-item life">
					<p class="cn" >
						<a  href="">创意生活</a>
					</p>
					<p class="en">
						<a   href="">LIFE STYLE</a>
					</p>
				</li>
			</ul>
			<div class="logo">
				<a href=""></a>
			</div>
			<div class="header-tool float-right">
				<div class="search float-left searchcateboys">
					<form action="" method="get">
						<div class="searchdiv">
							<input type="search" name="" id="" value="" class="seagoods"/>
						</div>
						<a href="" class="subsea">搜索</a>
					</form>
				</div>
				<div id="miniCartBox">
					<div id="goodsnum"><?php echo $cartGoodsNum?></div>
					<div class="gobuy-wrapper">
						<?php if($cartGoodsNum !=0){?>
                
						<div id="gobuy-notempty">
							<div class="goods-list-wrapper">
								<ul class="goods-list">
									<?php foreach ($data['goods'] as $k=>$v){?>
									<!--购物车商品遍历开始-->
									<li class="goods-item">
										<a href="">
											<img class="goods-img" src="<?php echo $v['listpic']?>" alt="" />
										</a>
										<div class="goods-detail">
											<h3 class="content">
												<a href="<?php echo U('Content/index',array('gid'=>$v['id']))?>"><?php echo $v['name']?></a>
											</h3>
											<h3 class="style">
												<?php foreach ($v['options'] as $kk=>$vv){?>
												<?php echo $kk?>:
												<span class="color"><?php echo $vv?></span>
												<?php }?>
											</h3>
										</div>
										<div class="goods-price">
											<h3 class="priceandnum">
												<span class="price">￥<?php echo $v['price']?></span>
												x
												<span class="num"><?php echo $v['num']?></span>
											</h3>
											<a class="delete goodscardelete" sid="<?php echo $k?>" href="javascript:void(0)">删除</a>
										</div>
									</li>
									<!--购物车商品遍历结束-->
									<?php }?>
								</ul>
								<ul class="activity-list">
									<li class="activity-item">
										<span class="activity-name">免运费</span>
										<span class="activity-content">全场免运费</span>
									</li>
								</ul>
							</div>
							<div class="gobuy-notempty-footer">
								<h3>
									<a href="<?php echo U('Cart/index')?>">去购物车结算</a>
								</h3>
							</div>
						</div>
						<?php }else{?>
						<div id="Cartdetail">
							<span id="information">
								你的购物车暂时无商品
							</span>
						</div>
						
               <?php }?>
					</div>
					
					
				</div>
			</div>
			
			
		</div>
	</div>